#include <stdio.h>
#include <string.h>
#include "hmacmd5.h"

void main()
{
	char key[1024], buf[1024], digest[16], hex[33];
	struct HmacMd5Context hmac;
	while (1)
	{
		gets(key);
		gets(buf);
		printf("HMAC-MD5(key=\"%s\", data=\"%s\")= ", key, buf);
		HmacMd5Init(&hmac, key, strlen(key));
		HmacMd5Update(&hmac, buf, strlen(buf));
		HmacMd5Final(digest, &hmac);
		HmacMd5HexString(hex, digest);
		printf("HEX %s\n", hex);
	}
}

